<script>
    var reviewFormMessages = {"nameemptyerror":"{%The Name field cannot be empty%}",
             "emailemptyerror":"{%The Email field cannot be empty%}",
             "emailregexerror":"{%Please enter a valid email address%}",
             "reviewcontentemptyerror":"{%The review field cannot be empty%}",
             "reviewcaptchainvaliderror":"{%The Captcha entered code is invalid%}",
             "reviewcaptchaemptyerror":"{%The Captcha field cannot be empty%}",
             "reviewunrecognizederror":"{%Unrecognized error. Please, try again later%}",
             "status":"{%status%}",
             "added":"{%Your review was added%}",
             "addedwait":"{%Your review was added and awaits for moderation%}",
             "proccessing":"{%Sending comment%}",
             "status":"{%status%}"
             };
             
</script>

<div id="seotoaster" class="reviewmsg">
    <div style="z-index:999;width:300px;display:none;">
        <ul style="list-style: none"></ul>
    </div>
</div>
<script type="text/javascript" src="<?php echo $this->siteUrl;?>system/js/shopping/review.js">
</script>

<form name="review-for-product-<?php echo $this->productId;?>" id="review-for-product-<?php echo $this->productId;?>" action="javascript:;" class="review-form">
	<fieldset><legend>{%Post a review about%} <?php echo $this->productName; ?>:</legend>
		<p>
			<label >{%Name%}:<span>*</span></label>
			<input type="text" id="review-name-<?php echo $this->productId;?>" name="name" value="" />
		</p>

		<p>
			<label >{%E-mail (will not be published)%}:<span>*</span></label>
			<input type="text" id="review-email-<?php echo $this->productId;?>" name="email" value="" />
		</p>

		<p>
			<label>{%Website%}:</label>
			<input type="text" id="review-website-<?php echo $this->productId;?>" name="website" value="http://" />
		</p>

<!--		<p>
			<label >{%Notify me of followup comments via e-mail.%}</label>
			<input type="checkbox" id="review-notify-<?php echo $this->productId;?>" name="notify" value="" />
		</p>-->

        <p>
            <label>{%Short description%}:</label>
            <input type="text" id="review-topic-<?php echo $this->productId;?>" name="topic"/>
        </p>

		<p>
			<label >{%Full review:%}<span>*</span></label>
			<textarea name="review-content" id="review-content-<?php echo $this->productId;?>" rows="4" cols="30"></textarea>
		</p>

		<div id="captcha">
			<img style="width:200px; border:none;" id="captcha-image" src="<?php echo $this->siteUrl; ?>tmp/<?php echo $this->captchaId ?>.png" alt=""/><br />
			<label >{%Enter the string above%}:<span>*</span></label>
			<input type="text" name="captcha-input" id="captcha-input" />
			<input type="hidden" value="<?php echo $this->captchaId ?>" id="captcha-id" name="captcha-id"/>
		</div>

		<p>
			<input id="submit-comment" type="submit" value="{%Post Review%}" />
		</p>
		
        <input type="hidden" name="productId" value="<?php echo $this->productId;?>" />
	</fieldset>
</form>

<div>
    <div class="hreview">{%Reviews for%} <span class="item"><a class="url fn" href="<?php echo $this->siteUrl.$this->productPage.'.html'; ?>" title="<?php echo $this->productName; ?>"><?php echo $this->productName; ?></a></span></div>

    <ul id="reviews-for-product-<?php echo $this->productId; ?>" class="product-reviews">
    <?php if (is_array($this->reviews)) : ?>
        <?php foreach ($this->reviews as $review): ?>
                <li id="review-<?php echo $review['id'];?>" class="hreview" <?php echo (!$review['publish'] && $this->isLogged)?'style="border:1px red dotted;"':'';?>>
                    <span class="item" style="display:none;">
						<span class="type">product</span>
                        <a class="url fn" href="<?php echo $this->siteUrl.$this->productPage.'.html'; ?>"><?php echo $this->productName; ?></a>
                    </span>
                    <?php if ($this->isLogged) : ?>
                    <p style="float:right">
                        <a href="javascript:;" class="deletereview" onclick="if(confirm('{%Are you sure want to delete this review%}?')){deleteReview(<?php echo $review['id']; ?>)}">
                            <img alt="Delete this comment" src="<?php echo $this->siteUrl; ?>system/images/ico_delete.gif"/>
                        </a>
                        <?php if (!$review['publish']) :?>
                        <a href="javascript:;" class="publishreview" onclick="if(confirm('{%Are you sure to publish this review%}?')){publishReview(<?php echo $review['id']; ?>)}">{%Publish%}</a>
                        <?php endif;?>
                    </p>
                    <?php endif ;?>
                    <?php if ($review['topic']!='') :?>
                    <p class="summary"><?php echo $review['topic'];?></p>
                    <?php endif;?>
                    <div class="description"><p><?php echo $review['content']?></p></div>
                    <p class="reviewer vcard">Reviewed by
                        <a class="url fn" rel="nofollow" href="<?php echo $review['user_website']; ?>"><?php echo $review['user_name']; ?></a>
                        <abbr class="dtreviewed" title="<?php echo date(DATE_ISO8601, strtotime($review['date']));?>"><?php echo $review['date'];?></abbr>
                    </p>
                    <?php /* Remove this line when published
                    <p class="review-rank">
                        Was this review helpful to you?
                        <form class="vote-for-review" name="vote-for-review-<?php echo $review['id']; ?>" >
                            <input type="button" class="vote-for-review-btn" name="vote-yes" value="yes" />
                            <input type="button" class="vote-for-review-btn" name="vote-no" value="no" />
                        </form>
                        <span class="rank" id="rank-for-review-<?php echo $review['id'];?>"><?php echo $review['rank'] ; ?></span>
                    </p>
                     Remove this line when published */;?>
                </li>            
        <?php endforeach; ?>
    <?php endif; ?>
    </ul>
    <?php if (!$this->noMoreLink):?>
    <p>
        <a class="morereviews" id="more-for-<?php echo $this->productId; ?>" href="javascript:;" onclick="loadMoreReviews(<?php echo $this->productId; ?>)" >More</a>
    <p>
    <?php endif; ?>
</div>